<div class="opts">
  <% if !turbolinks_ios? %>
    <%= likeable_tag(@article) %>
    <% if !owner?(@article) %>
      <%= topic_favorite_tag(@article) %>
    <% end %>
  <% end %>

  <% if admin? %>
    <% if !@article.excellent? %>
      <%= link_to raw("<i class='fa fa-award'></i> 加精"), action_article_path(@article.id, type: 'excellent'), title: "设为精华帖" , method: "post", remote: true %>
    <% end %>
  <% end %>

  <% if current_user %>
    <%= link_to raw("<i class='fa fa-flag'></i> " + t('common.tip_off')), new_tip_off_path(content_url: request.original_url, content_author_id: user_id_wrapper(@article.user)), remote: true, title: t('common.tip_off') %>
  <% end %>
  <span class="pull-right opts">
    <% if owner?(@article) or admin? %>
      <% if can?(:close, @article) %>
        <% if !@article.closed? %>
          <%= link_to raw("<i class='fa fa-check'></i>"), action_article_path(@article, type: 'close'), method: 'post', title: "关闭讨论／问题已解决", remote: true, data: { toggle: 'tooltip' } %>
        <% else %>
          <%= link_to raw("<i class='fa fa-undo'></i>"), action_article_path(@article, type: 'open'), method: 'post', title: "重新开启话题", remote: true, data: { toggle: 'tooltip' } %>
        <% end %>
      <% end %>
      <%= link_to "", edit_column_article_path(@article.column.id, @article), class: "fa fa-edit", title: "修改本帖" %>
      <% if can?(:destroy, @article) %>
        <%= link_to "", article_path(@article.id), method: :delete, remote: true, 'data-confirm': t("common.confirm_delete"), class: "fa fa-trash", title: "删除本帖" %>
      <% end %>
    <% end %>

    <% if owner?(@article) or admin? %>
      <%= link_to raw("<i class='fa fa-plus'></i>"), append_topic_path(@article), remote: true, title: "追加附言" %>
    <% end %>
    <%= link_to raw("<i class='fab fa-weixin'></i>"), show_wechat_article_path(@article), target: "_blank", title: "微信排版" %>
    <% if editor? or admin? %>
      <%= link_to "", raw_markdown_topic_path(topic_id: @article.id), class: "fas fa-file", title: "markdown" %>
    <% end %>
  </span>
</div>
